package com.zhanggm.springcloud.user.service;

import com.zhanggm.springcloud.user.pojo.User;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    /**
     * 根据用户id查询用户
     * @param id
     * @return
     */
    public User getUserById(Integer id){
        User user = new User();
        user.setId(id);
        user.setUsername("admin"+id);
        return user;
    }

    /**
     * 根据用户id，查询用户名称
     * @param id
     * @return
     */
    public String getUsernameById(Integer id){
        return getUserById(id).getUsername();
    }

}
